#include "stdafx.h"
#include "Map.h"
#include "Animal.h"
#include "ReflexDeflex.h"
#include<iostream>
#include<vector>
using namespace std;
Map::Map()
{
	for (int i = 0; i < MAPX; i++)
	{
		locationMap.push_back(vector<Animal *>());
		for (int j = 0; j < MAPY; j++)
		{
			Animal* animal= nullptr;
			locationMap[i].push_back(animal);
		}
	}
}


Map::~Map()
{
}

Animal* Map::getLocationMap(XY* xy)
{
	return locationMap[xy->getX()][xy->getY()];
}

void Map::setLocationMap(Animal* animal, XY* xy)
{
	locationMap[xy->getX()][xy->getY()] = animal;
}

void Map::delLocationMap(XY xy)
{
}

Map* Map::getInstanceCMap()
{

	static Map* instanceMap;
	if(instanceMap== nullptr)
	 instanceMap = new Map();
	return instanceMap;
}
